#pragma once
#include "Card.h"

class Player
{
public:

	enum PlayerChooise
	{
		Fold = 0,
		Call = 1,
		Reise = 2,
		Check = 3,
	};

	Player(unsigned int money = 0, unsigned short CardsN = 2)
	: CardsN(CardsN)
	, money(money)
	{};
	virtual ~Player(void){};
	void Print(ostream &out)
	{

	}
	Card GetCard(unsigned short i)
	{
		if( i < CardsN )
			return cards[i];
		else
			return Card();
	}
	void SetCards(Card card1, Card card2)
	{
		cards[0] = card1;
		cards[1] = card2;
	}

	string GetCardsStr()
	{
		string cardsStr = "_____";
		cardsStr[0] = cards[0].GetValueStr();
		cardsStr[1] = cards[0].GetLearStr();
		cardsStr[2] = ' ';
		cardsStr[3] = cards[1].GetValueStr();
		cardsStr[4] = cards[1].GetLearStr();
		return cardsStr;
	}

	void SetMoney(unsigned int money)
	{
		this->money = money;
	}

	unsigned int GetMoney()
	{
		return money;
	}

	bool SubMoney(unsigned short subMoney)
	{
		if ( (money - subMoney) > 0)
		{
			money -= subMoney;
			return true;
		}else
			return false;
	}

	void AddMoney(unsigned short addMoney)
	{
		this->money += addMoney;
	}

	Card *GetCards()
	{
		return cards;
	}

	PlayerChooise GetPlayerChooise()
	{
		//todo
		return Call;
	}

private:
	unsigned short CardsN;
	Card cards[2];
	unsigned int money;
	PlayerChooise LastPlayerChooise;
};
